<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <title>首页</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/main.css">
</head>

<body>
    <div class="app">
        <div class="common-header">
            <div class="iconfont goback" @click="backPage">&#xe66f;</div>
            <div class="title" v-text="titleName"></div>
            <div class="edit-btn" @click="showEditDialog">{{isEdit ? '取消' : '编辑'}}</div>
        </div>
    </div>
    <script src="../../script/api.js"></script>
    <script src="../../script/flexible.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/vue.min.js"></script>
    <script src="../../script/iconfont.js"></script>
    <script>
        apiready = function() {

            vm = new Vue({
                el: '.app',
                data() {
                    return {

                        activeNavs: ["peijian", "chushou"],
                        activeNav: "chushou",
                        isEdit: false,
                        selectAllClass: false,
                        titleName: null
                    }
                },

                created() {
                    this.titleName = api.pageParam.title;
                    
                },

                mounted() {
                    var header = $api.dom(".common-header")
                    var headerH = $api.fixStatusBar(header);
                    api.openFrame({
                        name: 'collectandvisited_frm',
                        url: 'collectandvisited_frm.html',
                        rect: {
                            marginTop: headerH + 10,
                            marginBottom: api.pageParam.footerH,
                            w: 'auto'
                        },
                        pageParam: api.pageParam
                    });

                },
                methods: {
                    showEditDialog() {
                        this.isEdit = !this.isEdit;
                        api.sendEvent({
                            name: 'cvIsEdit',
                            extra: {
                                isEdit: this.isEdit
                            }
                        })
                    },
                    backPage() {
                        api.closeWin();
                    }
                },
            })
            api.addEventListener({
                name: 'cvIsEdit'
            }, function(ret) {
                vm.isEdit = ret.value.isEdit;
            })
        }
    </script>
</body>

</html>